New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More

ci-info

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ci-info

Get details about the current Continuous Integration environment


Version published
Maintainers
2
Created

What is ci-info?

The ci-info npm package provides information about the Continuous Integration (CI) environment that your code is running in. It can detect if the current environment is a CI server and provide details about which one it is. This is useful for adjusting the behavior of your application or scripts based on whether they are being run in a CI environment or not.

What are ci-info's main functionalities?

Detecting CI environment

This feature allows you to check if your code is running in a CI environment. The property 'isCI' will be true if it is, or false otherwise.

const ci = require('ci-info');

if (ci.isCI) {
  console.log('The code is running in a CI environment.');
} else {
  console.log('This is not a CI environment.');
}

Identifying specific CI service

This feature allows you to check for specific CI services. Each supported CI service has a corresponding property that will be true if the code is running on that service.

const ci = require('ci-info');

if (ci.TRAVIS) {
  console.log('The code is running on Travis CI.');
}

Getting CI service name

This feature allows you to retrieve the name of the CI service that the code is running on, if it is running in a CI environment.

const ci = require('ci-info');

if (ci.isCI) {
  console.log(`The CI service name is ${ci.name}`);
}

Other packages similar to ci-info

FAQs

Package last updated on 12 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts